package sevice;

import dao.ProductDao;
import dao.ProductDaoImpl;
import pojo.Product;

import java.util.List;

/**
 * @author 郝雷蒙
 * @Description
 * @date 2020/11/26 9:46
 */
public class ProductServiceImpl implements ProductService{
    private ProductDao productDao = new ProductDaoImpl();



    @Override
    public List<Product> getAllproducts(String order) {
        return productDao.selectAllProducts(order);
    }

    @Override
    public Product getAllSumPrice() {
        return productDao.selectAllSumPrice();
    }

    @Override
    public Integer delAllProducts(List<Integer> dIds) {
        return productDao.deleteAllProducts(dIds);
    }

    @Override
    public Integer setOneProduct(Product product) {
        return productDao.updateOneproduct(product);
    }

    @Override
    public Product getSetProductById(Integer did) {
        return productDao.selectproductById(did);
    }
}
